<?php

class GotoAction extends CAction
{
	private function invalidateFight()
	{
		$fight=Fight::loadFight();
		if($fight) {
		    $fight->valid=false;
		    Fight::saveFight($fight);
        }
	}

	public function run()
	{
        $this->invalidateFight();

		$id=$_GET['id'];
        $location=Location::loadLocation($id);
		$this->controller->setUserLocationId($id);
		$this->controller->render($location->view);
	}
}

?>
